//
//  FourPicture.m
//  FairyDream
//
//  Created by dllo on 15/8/25.
//  Copyright (c) 2015年 dreams. All rights reserved.
//

#import "FourPicture.h"
#import "CustomView.h"
#define Width 375 / 4
#define PIcWidth (375 - 80) / 4
@implementation FourPicture

- (void)dealloc
{
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView
{
    for (int i = 0; i < 4; i++) {
        CustomView *FourView = [[CustomView alloc] initWithFrame:CGRectMake( 10 +Width * i, 0, PIcWidth, 100)];
        FourView.backgroundColor = [UIColor clearColor];
        [FourView setTag:i + 1];
        [self setValueForView:FourView];
        [self addSubview:FourView];
        
    }
    
    
}

- (void)setValueForView:(CustomView *)fourView
{
    if (fourView.tag == 1) {
        fourView.colorLable.backgroundColor = [UIColor yellowColor];
        fourView.textLable.text = @"看锦囊";
        [fourView.imageV setImage:[UIImage imageNamed:@"jinnang.png"]];
    }
   else if (fourView.tag == 2) {
        fourView.colorLable.backgroundColor = [UIColor redColor];
        fourView.textLable.text = @"抢折扣";
        [fourView.imageV setImage:[UIImage imageNamed:@"zhekou.png"]];
    }
   else if (fourView.tag == 3) {
        fourView.colorLable.backgroundColor = [UIColor greenColor];
        fourView.textLable.text = @"订酒店";
        [fourView.imageV setImage:[UIImage imageNamed:@"jiudian.png"]];
    }
   else if (fourView.tag == 4) {
       fourView.colorLable.backgroundColor = [UIColor grayColor];
       fourView.textLable.text = @"旅途中";
       [fourView.imageV setImage:[UIImage imageNamed:@"lvtu.png"]];
    }
}

@end
